﻿package component.fileupload.vo;

import java.io.InputStream;

/**
 * 上传文件的信息对象
 */
public class UploadFileVO {
	private int index;// 上传文件的顺序号,从0开始
	private String fieldName;// 表单域的元素名称
	private String filePath;// 上传文件的路径
	private String fileName;// 上传文件的名称
	private String saveFileName;// 上传文件的保存名称
	private String suffix;// 上传文件的后缀名
	private String serverSaveFilePath;// 上传文件保存在服务器里的绝对路径
	private String dbSaveFilePath;// 上传文件保存在数据库里的相对路径

	private InputStream inputStream;// 上传文件的流
	private byte[] binArray;
	private long startData = 0;
	private long endData = 0;
	private long fileSize = 0;// 上传文件的大小

	private Object destroyObj;// 需要销毁的对象

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

	public InputStream getInputStream() {
		return inputStream;
	}

	public void setInputStream(InputStream inputStream) {
		this.inputStream = inputStream;
	}

	public byte[] getBinArray() {
		return binArray;
	}

	public void setBinArray(byte[] binArray) {
		this.binArray = binArray;
	}

	public long getStartData() {
		return startData;
	}

	public void setStartData(long startData) {
		this.startData = startData;
	}

	public long getEndData() {
		return endData;
	}

	public void setEndData(long endData) {
		this.endData = endData;
	}

	public long getFileSize() {
		return fileSize;
	}

	public void setFileSize(long fileSize) {
		this.fileSize = fileSize;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getSaveFileName() {
		return saveFileName;
	}

	public void setSaveFileName(String saveFileName) {
		this.saveFileName = saveFileName;
	}

	public String getSuffix() {
		if (fileName.indexOf(".") == -1)
			return "";
		return fileName.substring(fileName.lastIndexOf(".") + 1);
	}

	public String getServerSaveFilePath() {
		return serverSaveFilePath;
	}

	public void setServerSaveFilePath(String serverSaveFilePath) {
		this.serverSaveFilePath = serverSaveFilePath;
	}

	public String getDbSaveFilePath() {
		return dbSaveFilePath;
	}

	public void setDbSaveFilePath(String dbSaveFilePath) {
		this.dbSaveFilePath = dbSaveFilePath;
	}

	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}

	public Object getDestroyObj() {
		return destroyObj;
	}

	public void setDestroyObj(Object destroyObj) {
		this.destroyObj = destroyObj;
	}

}
